import axios from 'axios';

const Get = (url: string) => {
  console.log(url);
  return (target: any, key: any, descriptor: PropertyDescriptor) => {
    console.log(target, key, descriptor);
    const method = descriptor.value;
    axios
      .get(url)
      .then((res) => {
        method(res);
      })
      .catch();
  };
};

class Contoller {
  constructor() {}
  @Get('https://api.apiopen.top/api/getHaoKanVideo?page=0&size=10')
  getList(res: any) {
    console.log(res.data.result);
  }
}
